package com.symone.webcms.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotations.Version;

import lombok.Data;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModelProperty;

/**
 *   @description : SiteNav 实体类
 *   ---------------------------------
 * 	 @author Archer Chu
 *   @since 2019-03-23
 */
@Data
@Accessors(chain = true)
@TableName("sys_site_nav")
public class SiteNav extends Model<SiteNav> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
	@ApiModelProperty("ID")
	@TableId(value="id", type= IdType.AUTO)
	private Long id;
    /**
     * 语言code
     */
	@ApiModelProperty("语言code")
	private String lang;
    /**
     * 上级ID
     */
	@ApiModelProperty("上级ID")
	private Long pid;
    /**
     * 目录名称
     */
	@ApiModelProperty("目录名称")
	private String name;
	private String position;
	private String icon;
	private String picture;
    /**
     * 列表页地址
     */
	@ApiModelProperty("列表页地址")
	private String url;
    /**
     * 描述
     */
	@ApiModelProperty("描述")
	private String memo;
    /**
     * 排序
     */
	@ApiModelProperty("排序")
	private Integer sorting;
    /**
     * 状态
     */
	@ApiModelProperty("状态")
	private Boolean state;
	private Boolean deleted;
	@TableField("create_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;
	@TableField("update_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date updateTime;

	@TableField(exist = false)
	private List<SiteNav> children;

	@Override
	protected Serializable pkVal() {
		return this.id;
	}
}
